<!-- charity.html -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>公益</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
  <div class="container">
    <header class="header">
      <button class="back-btn" onclick="window.history.back()">←</button>
      <h2>公益</h2>
    </header>
    
    <div class="section">
      <h3>我的公益</h3>
      <div class="charity-stats">
        <div class="stat-item">
          <div class="stat-value">18</div>
          <div class="stat-label">公益项目</div>
        </div>
        <div class="stat-item">
          <div class="stat-value">¥1,250</div>
          <div class="stat-label">累计捐赠</div>
        </div>
        <div class="stat-item">
          <div class="stat-value">365</div>
          <div class="stat-label">公益天数</div>
        </div>
      </div>
      
      <div class="charity-projects">
        <h3 style="margin-top: 20px;">推荐项目</h3>
        <div class="project-item">
          <img src="{{ url_for('static', filename='img/xwgc.png') }}" alt="希望工程">
          <div class="project-info">
            <h4>希望工程助学</h4>
            <p>帮助贫困地区儿童完成学业</p>
            <div class="project-progress">
              <div class="progress-bar">
                <div class="progress" style="width: 65%;"></div>
              </div>
              <div class="progress-info">已筹65%</div>
            </div>
          </div>
        </div>
        <div class="project-item">
          <img src="{{ url_for('static', filename='img/hbxm.png') }}" alt="环保项目">
          <div class="project-info">
            <h4>绿色地球计划</h4>
            <p>植树造林，保护生态环境</p>
            <div class="project-progress">
              <div class="progress-bar">
                <div class="progress" style="width: 42%;"></div>
              </div>
              <div class="progress-info">已筹42%</div>
            </div>
          </div>
        </div>
      </div>
      
      <button onclick="viewAllProjects()" style="width: 100%; margin-top: 15px;">查看所有公益项目</button>
    </div>
  </div>
  
  <script>
    function viewAllProjects() {
      alert('正在查看所有公益项目...');
    }
  </script>
  
  <style>
    .charity-stats {
      display: flex;
      justify-content: space-around;
      text-align: center;
      margin: 15px 0;
    }
    
    .stat-value {
      font-size: 1.5em;
      font-weight: bold;
      color: var(--primary-color);
    }
    
    .stat-label {
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .charity-projects {
      margin-top: 15px;
    }
    
    .project-item {
      display: flex;
      padding: 12px 0;
      border-bottom: 1px solid var(--border-color);
    }
    
    .project-item:last-child {
      border-bottom: none;
    }
    
    .project-item img {
      width: 80px;
      height: 80px;
      border-radius: 8px;
      object-fit: cover;
      margin-right: 15px;
    }
    
    .project-info {
      flex: 1;
    }
    
    .project-info h4 {
      font-size: 16px;
      margin-bottom: 5px;
    }
    
    .project-info p {
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 8px;
    }
    
    .progress-bar {
      height: 6px;
      background: #e0e0e0;
      border-radius: 3px;
      overflow: hidden;
    }
    
    .progress {
      height: 100%;
      background: var(--primary-color);
    }
    
    .progress-info {
      font-size: 12px;
      color: var(--text-secondary);
      text-align: right;
      margin-top: 4px;
    }
  </style>
</body>
</html>